﻿
Public Class GridView_EntityDataModel
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Using myEntities As New PhonebookEntities()
            Dim allContacts = From contact In myEntities.contacts
                             Order By contact.lname Ascending
                             Select contact
            GridView1.DataSource = allContacts
            GridView1.DataBind()
        End Using

    End Sub

End Class